﻿/*******************************************************************************
 * Copyright © 2016-2020 北京网非科技有限公司 版权所有
 * Author: 北京网非科技有限公司
 * Description: 网非快速开发平台NET
 * Website：http://www.wfdot.com
*********************************************************************************/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace CubicFWNet.Data.SystemManage.Model
{
    [Table("User")]
    public partial class User
    {
        public User()
        {
            this.UserName = string.Empty;
            this.Password = string.Empty;
            this.FamilyName = string.Empty;
            this.SortNo = 0;
            this.Memo = string.Empty;
            this.Status = true;
            this.CreateTime = DateTime.Now;
        }

        [Key]
        [DisplayName("主键")]
        public System.Guid Id { get; set; }

        [DisplayName("账户")]
        [Required(ErrorMessage = "请输入用户名/手机号/邮箱。")]
        [StringLength(50,ErrorMessage="最多只能输入50个字符。")]
        [Index("IX_UserName_User",IsClustered=false,IsUnique=true)]
        [Column("UserName",TypeName = "nvarchar")]
        public string UserName { get; set; }

        [DisplayName("密码")]
        [Required(ErrorMessage = "请输入密码。")]
        [StringLength(128, ErrorMessage = "最多只能输入128个字符。")]
        [Column(TypeName="varchar")]
        public string Password { get; set; }

        [DisplayName("姓名")]
        [Required(ErrorMessage = "请输入姓名。")]
        [StringLength(50, ErrorMessage = "最多只能输入50个字符。")]
        [Index("IX_FamilyName_User", IsClustered = false)]
        [Column(TypeName = "nvarchar")]
        public string FamilyName { get; set; }
        /// <summary>
        /// true:启用  false:禁用
        /// </summary>
        [DisplayName("状态")]
        [DefaultValue(true)]
        public bool Status { get; set; }

        [DisplayName("创建时间")]
        public System.DateTime CreateTime { get; set; }

        public System.Guid CreatorId { get; set; }

        [DisplayName("排序号")]
        public int SortNo { get; set; }

        [DisplayName("备注")]
        [StringLength(1024, ErrorMessage = "最多只能输入1024个字符。")]
        [Column(TypeName = "nvarchar")]
        public string Memo { get; set; }

        /// <summary>
        /// 角色名称
        /// </summary>
        [NotMapped]
        [DisplayName("角色")]
        [Column(TypeName = "nvarchar")]
        public string RoleNames { get; set; }
    }
}
